package com.huixuebao.after.tencent;


import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.profile.Language;

import com.tencentcloudapi.cvm.v20170312.CvmClient;
import com.tencentcloudapi.cvm.v20170312.models.*;
import com.tencentcloudapi.ocr.v20181119.OcrClient;
import com.tencentcloudapi.ocr.v20181119.models.BizLicenseOCRRequest;
import com.tencentcloudapi.ocr.v20181119.models.BizLicenseOCRResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DescribeZones {

    public static void main(String[] args) {
        try{

            Credential cred = new Credential("AKIDVnTSBlMuCF2lJaEQxEFza4TimbQ6lz3s", "lHZbMp1pOfhfQ6QVJqGUTBd0FI4mNimc");

            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint("ocr.tencentcloudapi.com");

            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);

            OcrClient client = new OcrClient(cred, "ap-shanghai", clientProfile);

            BizLicenseOCRRequest req = new BizLicenseOCRRequest();
            req.setImageUrl("https://ocrdemo-temp-1254418846.cos.ap-guangzhou.myqcloud.com/1304426660-3.jpg?t=1609162695311");

            BizLicenseOCRResponse resp = client.BizLicenseOCR(req);

            System.out.println(BizLicenseOCRResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            System.out.println(e.toString());
        }
    }
}
